package com.blb.community_admin.entity;


import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ZyRoom {
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    @ExcelProperty("房屋ID")
    private long roomId;
    @JsonSerialize(using = ToStringSerializer.class)
    @ExcelProperty("小区ID")
    private long communityId;
    @JsonSerialize(using = ToStringSerializer.class)
    @ExcelProperty("楼栋ID")
    private long buildingId;
    @JsonSerialize(using = ToStringSerializer.class)
    @ExcelIgnore
    @ExcelProperty("单元ID")
    private long unitId;
    @ExcelProperty("备注")
    private long roomLevel;
    @ExcelProperty("房间编号")
    private String roomCode;
    @ExcelProperty("房间名称")
    private String roomName;
    @ExcelProperty("房间面积")
    private double roomAcreage;
    @ExcelProperty("算费系数")
    private double roomCost;
    @ExcelProperty("房屋状态")
    private String roomStatus;
    @ExcelIgnore
    private String roomIsShop;
    @ExcelIgnore
    private String roomSCommercialHouse;
    @ExcelProperty("房间类型")
    private String roomHouseType;
    @ExcelIgnore
    private String createBy;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;
    @ExcelIgnore
    private String updateBy;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private LocalDateTime updateTime;
    @ExcelIgnore
    private String remark;
    //楼栋对象
    @TableField(exist = false)
    @ExcelIgnore
    private ZyBuilding zyBuilding;

    @TableField(exist = false)
    @ExcelIgnore
    private ZyCommunity zyCommunity;

    @TableField(exist = false)
    @ExcelIgnore
    private ZyUnit zyUnit;


//  public ZyRoom(long roomLevel, String roomCode, String roomName) {
//    this.roomLevel = roomLevel;
//    this.roomCode = roomCode;
//    this.roomName = roomName;
//  }
//
//  public ZyRoom(long roomId, long roomLevel, String roomCode, String roomName) {
//    this.roomId = roomId;
//    this.roomLevel = roomLevel;
//    this.roomCode = roomCode;
//    this.roomName = roomName;
//  }

}
